<%@page contentType="text/html; charset=euc-kr"%>
<%@page import="java.util.List" %>
<%@page import="java.util.Iterator" %>
<%@page import="com.iheart.member.model.MemberMModel"%>
<%@page import="com.iheart.address.AddressManager"%>
<%@page import="com.iheart.message.box.MsgBoxManager"%>
<%@page import="com.iheart.statistics.StatisticsManager"%>
<%@page import="com.iheart.member.MemberManager"%>
<%@page import="com.iheart.payment.PayManager"%>
<jsp:useBean id="searchM" class="com.iheart.common.model.SearchModel" scope="page"/>
<jsp:setProperty name="searchM" property="*"/>
<jsp:useBean id="iwebUtil" class="com.iheart.common.IWEBUtil" scope="page"/>
<%
	MemberMModel sesM = null;
	
	if ( session.getAttribute("ADMIN") != null ) {
		sesM = (MemberMModel)session.getAttribute("ADMIN");
	} else {
		response.sendRedirect(request.getContextPath() + "/admin/noPermission.jsp");
		return;
	}
	
	String fName = "";
	String mode = iwebUtil.nvlCheck(request.getParameter("mode"));
	if("member_list".equals(mode)){
		MemberManager memM = new MemberManager();
		fName = memM.getMemberListExport(searchM);  	
	}  else 	if("admin_list".equals(mode)){
		MemberManager memM = new MemberManager();
		fName = memM.getAdminListExport(searchM);
	} else 	if("statisticsByDate".equals(mode)){
		StatisticsManager memM = new StatisticsManager();
		fName = memM.getDateListExport(searchM);
	} else 	if("statisticsByUser".equals(mode)){
		StatisticsManager memM = new StatisticsManager();
		fName = memM.getUserListExport(searchM);		
	} else 	if("grade_list".equals(mode)){
		MemberManager memM = new MemberManager();
		fName = memM.getGradeListExport(searchM);
	} else 	if("goods_list".equals(mode)){
		PayManager memM = new PayManager();
		fName = memM.getPayListAdminExport(searchM);		
	} else 	if("pay_history".equals(mode)){
		PayManager memM = new PayManager();
		fName = memM.getPayHistoryListAdminExport(searchM);		
	}		
	response.sendRedirect(request.getContextPath()+"/download.do?fName="+fName);
	
	//response.sendRedirect(request.getContextPath()+"/admin/charge/fDownload.jsp?fName="+fName);
	
	System.out.println("################# fName ++++++ "+ fName);
%>

